﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zocono.WCS.Domain.PlcBytesObject
{
    /// <summary>
    /// Plc在线离线状态，设备号为空
    /// </summary>
    public class PlcOnLineStateBO : BytesObjectBase
    {
        /// <summary>
        /// plc 状态 0离线 1在线
        /// </summary>
        public short PlcState { get; set; }

        //public override byte[] Derialize()
        //{
        //    throw new NotImplementedException();
        //}

        public override void Serialize(long plcConnectionID, long plcReadDbID, int bytesIndex, int bytesLength, int objectIndex, int objectLength, string objectType, string ScEquipmentCode, byte[] bytes)
        {
            PlcConnectionID = plcConnectionID;
            PlcReadDbID = plcReadDbID;
            BytesIndex = bytesIndex;
            BytesLength = bytesLength;
            ObjectIndex = objectIndex;
            ObjectLength = objectLength;
            ObjectType = objectType;
            EquipmentCode =ScEquipmentCode;
            //EquipmentCode = "PlcOnLineStateBO";

            PlcState = HelperByte.GetIntAt(bytes, 0);
        }
    }
}
